Skip to content

chore(Logic/Relation): golf using grind#41610

Open
SnirBroshi wants to merge 1 commit into
leanprover-community:masterfrom
SnirBroshi:golf/relation-grind
Open

chore(Logic/Relation): golf using grind#41610
SnirBroshi wants to merge 1 commit into
leanprover-community:masterfrom
SnirBroshi:golf/relation-grind

Conversation

@SnirBroshi

Copy link
Copy Markdown
Collaborator

Open in Gitpod

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown

PR summary 87e8eb9264

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 87e8eb9).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


No changes to strong technical debt.

No changes to weak technical debt.

Current commit 87e8eb9264
Reference commit c368140668

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-logic Logic (model theory, etc) label Jul 11, 2026
@themathqueen

Copy link
Copy Markdown
Collaborator

!radar

@leanprover-radar

leanprover-radar commented Jul 11, 2026

Copy link
Copy Markdown

Benchmark results for 87e8eb9 against c368140 are in. No significant results found. @themathqueen

  • 🟥 build//instructions: +41.6G (+0.03%)

Small changes (1🟥)

  • 🟥 build/module/Mathlib.Logic.Relation//instructions: +1.3G (+6.60%)

| symm => apply h.symm; assumption
| trans _ _ _ _ _ hab hbc => exact h.trans hab hbc)
(EqvGen.rel a b)
⟨by intro h; induction h <;> grind [Equivalence], .rel a b⟩

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
by intro h; induction h <;> grind [Equivalence], .rel a b⟩
fun h ↦ by induction h <;> grind [Equivalence], .rel a b⟩

@grunweg

grunweg commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Here and in your other grind golfing PR: can you add a performance comparison (look at euprunin's PRs for an example) please? Thanks!

@grunweg grunweg added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 11, 2026
· exact Or.inr (single bd)
· cases U bd be
exact Or.inl ec
· grind [cases_head IH, Relator.RightUnique]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the most extreme the whole proof could even be

induction ab with grind [→ cases_head, Relator.RightUnique]

though some compromise inbetween along the spectrum of readability/performance is probably preferable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. t-logic Logic (model theory, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants